﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Mukhopatro.BusinessLogicLayer;
using Mukhopatro.BusinessEntities;
using Mukhopatro.Helpers;

public partial class controls_wucLoadCMS : System.Web.UI.UserControl
{
    public ContentType DisplayContentType
    {
        get;
        set;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadCMS();
        }
    }

    private void LoadCMS()
    {
        CustomerContentBLL bll = new CustomerContentBLL();
        CustomerContent cms = bll.GetCustomerContent(DisplayContentType.ToString(), SessionManager.CustomerId);

        if (cms != null)
        {
            litTitle.Text = cms.CmsTitle;
            litCMS.Text = Server.HtmlDecode(cms.CmsContent);
        }
    }
}
